<?php  
header("content-type:text/html;charset=utf-8");
?> 


<!doctype html>
<html lang="zh-cn">
 <head>
  <meta charset="UTF-8">  
  <title>图书列表</title>
 </head>
 <body>
 
 
 <center><h3>图书列表</h3></center>
 <table align="center" width="80%" border=1> 
 <tr>
   <th>图书编号</th>
   <th>书名</th>   
   <th>书类</th>
   <th width='80'>图片</th>
   <th>图书简介</th>
   <th>上传时间</th>
   <th>上传人</th>
    <th>借阅次数</th> 
    <th>推荐次数</th>  
  
   <th>操作 <a href="admin.php?c=book&m=form">添加</a></th>
 </tr>

 <?php
/* if($data==false){
 	echo "没有";
 }else*/
  foreach ($data['books'] as $row) {
	 echo '<tr>';
	 echo '<td>'.$row['bid'].'</td>';
	 echo '<td>'.$row['bookname'].'</td>';	 
	 echo '<td>'.$row['typename'].'</td>';
	 echo '<td align="center"><img src="upload/'.$row['pic'].'" width=60 height=80 alt="无头像"></td>';  
   echo '<td>'.$row['intro'].'</td>'; 
   echo '<td>'.$row['uploaddate'].'</td>';
   echo '<td>'.$row['uploadadmin'].'</td>';
   echo '<td>'.$row['borrytime'].'</td>';
	 echo '<td>'.$row['hittime'].'</td>';
   
	 echo '<td>
  '.
   '<a href="admin.php?c=book&m=mod&id='.$row['bid'].' ">修改</a> | 
	 <a href="admin.php?c=book&m=del&id='.$row['bid'].'" onClick="return confirm(\'确定要删除吗？\');">删除</a></td>';
	 echo '</tr>';  
  }
  echo '</table>';  
  $totalrows = count($data['books']);
  echo "<table align='center'><tr><td>共有{$totalrows}本书</td></tr></table>"; 
 ?>
 </body>
</html>